package 网约车;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class RedTest extends Reducer<Text,Data,Data, NullWritable> {
    Data k = new Data();
    @Override
    protected void reduce(Text key, Iterable<Data> values, Context context) throws IOException, InterruptedException {
        for (Data data:values){
            k = data;
            context.getCounter("是否合格","总计").increment(1);
        }
        context.getCounter("是否合格","合格").increment(1);
        context.write(k,NullWritable.get());
    }
}
